home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
MATHEMAT
/
STATISTI
/
H277.ZIP
/
ESTAT21.ZIP
/
EASIDOC.EXE
/
ESCHAP08.DOC
< prev
next >
Wrap
Text File
|
1992-06-30
|
13KB
|
463 lines
Chapter 8: SPECIAL COMMANDS
8:1. Help
Format: H[elp]
The HELP command simply outputs a list of all the
commands available, together with a brief reminder of
their syntax. You may want to use the OUTPUT PRN command
to print this list out on paper so you can refer to it
when you do not have the manual handy.
Examples:
Select command - help
Select command - o prn
Select command - h
Select command - o close
Outputs list of commands to printer.
Output:
Help Titles
Basics [G] [ranks] col [if cond] Data [save] [filename]
List [if cond or Variables] Chisq [G] [Fish] [Num] [c r]
Wilcoxon [S] [col] Ttest [paired]
Anova [G or N] [col] Kendall's [col col]
Kolmogorov [G] [col] Regress [G] [col col [col]]
Multiple regression [col [col]] Component analysis [G]
Minimise [expression] Narrow cond
Widen [cond] Arithmetic [expression]
New [col or row or next] Label [col [name]]
Format [col or def [width dec]] Derive [col [expression]]
Delete [col or row or all] Echo
Input [filename or close] Output [filename or close]
Log [filename or close] Edit
Screen Sort [d[own]] [col]
Pause System [command]
Limits [cl] Copy [lc,tr,rc,br,new lc,new tr]
Macro [list or label exp] Quit
8:2. System
Format: Sy[stem] [command or program]
This allows you to issue DOS commands to the operating
system or even run other programs, provided there is
enough memory available. The commands specified are
exactly what you would type at the DOS prompt and
EASISTAT will pass them on unchanged.
Example:
Select command - sys dir
Produces a list of files in the current working
directory.
78
Special commands
Select command - sys time
Allows you to change the clock.
Select command - sys edit command.log
Runs the EDIT program to edit a file called COMMAND.LOG.
When the command has been executed then EASISTAT will
pause and wait for a keypress before continuing (unless
it is being run from a command file).
Comments
You can use this command to list directories to remind
yourself of the names of files you wish to use, or you
can delete old output files before writing to a file with
the same name. You can run a test editor to edit files
and then automatically return to EASISTAT when you have
finished without having to reload the program or read in
data again. Do not however attempt to edit a file that is
currently in use by EASISTAT, e.g. a command file that it
is in the middle of reading.
EASISTAT remains loaded in memory while the command is
performed, so there will not be as much memory available
to the second program as usual and if the second program
needs a large amount of memory it may not be able to run.
Do not run a memory resident or pop-up program using this
command because it will stay in memory and may prevent
EASISTAT from accessing memory which is in fact free.
Pop-up programs (such as EASIMATH) should be run before
EASISTAT is loaded.
If you are familiar with DOS you will probably realise
that instead of a program name one can actually enter
SYSTEM COMMAND and run another copy of DOS from
COMMAND.COM. Then many commands and programs can be
executed before finally returning to EASISTAT. When you
do wish to return to EASISTAT after doing this, enter
EXIT.
Because of the way DOS works it is not possible to
permanently change any "environment variables" from
within EASISTAT. This means that the DOS commands SET,
PROMPT and PATH will not have any effect if used from
within EASISTAT from the SYSTEM command. For example the
following line will not actually change the DOS search
path:
Select command - sys set path=c:\utils
If it is desired to change any environment variables in
this way then it is necessary to first quit EASISTAT.
This applies also to setting the FG_DISPLAY variable used
to inform EASIGRAF of the type of display in use.
79
Special commands
8:3. Screen
Format: S[creen]
This simply redraws the EASISTAT screen if an error has
occurred which has messed it up.
Example:
Select command - scr
8:4. Arithmetic
Format: Ar[ithmetic] [expression]
This command evaluates arithmetical and logical
expressions. Any such expression can be entered. If a
calculation is entered on the first line then it is
evaluated and the ARITHMETIC command finishes. If no
calculation is entered then EASISTAT will request one,
and will remain within the ARITHMETIC command until a
blank line or error is encountered.
80
Special commands
Examples:
Select command - ARITH
Enter calculation: 5 +5*38
Enter calculation: 2.6/7+(3.5-.6)pow(0.5)
Select command - ar 5 +5*38
One can use the probability look-up functions, e.g. to
find the significance of a chi-squared of 13.6 with 2
degrees of freedom:
Select command - ARITH 13.6PX2
If a column is specified then the value in the first
valid row is used. This means that an arithmetic command
can be put in an input file and used to carry out
manipulations of variables which are entered into the
first row:
Select command - ar
Enter calculation: c1 pow(1/3)
This outputs the cube root of the value in the first
column in the first valid row of the table.
Often it is convenient to have formulae contained in a
command file such as this:
e Normal approximation to binomial distribution
e
der v1 %1
der v2 %2
der v3 %3
e Observed value is:
ar v1
e Total number of trials is:
ar v2
e Expected ratio is:
ar v3
e One-tailed p value (with continuity correction):
ar 1-pn((abs(v1-v2*v3)-0.5)/((v2*v3*(1-v3))pow(0.5)))
i close
This calculates an approximation to a binomial
probability of an observed event occurring x times out of
n trials if the chance of such an event occurring on each
trial is p. If the command file name is BINOM it can be
run as follows:
Select command - INPUT BINOM 12 15 0.4
Here x is 12, n is 15 and p is 0.4.
Here's another file to solve quadratic equations. The
three coefficients are passed as parameters to the file:
Select command - INPUT QUAD 3 5 1
Command file QUAD contains the following lines:
81
Special commands
der v1 %1
der v2 %2
der v3 %3
e Solving quadratic equation with following coefficients:
ar
v1
v2
v3
((v2*v2-4*v1*v3)pow0.5-v2)/(2*v1)
(0-(v2*v2-4*v1*v3)pow0.5-v2)/(2*v1)
; blank line above to finish arithmetic command
i close
With coefficients 3, 5 and 1, these formulae find roots
at -0.232 and -1.434.
Using this kind of technique one can build up a
collection of command files for evaluating different
expressions and can use EASISTAT like a programmable
calculator. If the number output is very large or very
small then it will be output in exponential notation
(described in the section on arithmetic expressions).
8:5. Macro
Format: Ma[cro] [list or name expression]
This allows you to produce abbreviations of complicated
expressions so that you can refer to them more succintly.
The macro can thereafter be incorporated in other
expressions in the same way as a value or variable. This
facility is indispensable when dealing with complicated
mathematical formulae, although it is true that its
usefulness is somewhat limited by the inability to pass
any arguments to the expression. Here is an example where
we define a macro QUAD to evaluate a quadratic expression
with the first three variables as coefficients and the
fourth as the value to use, then we define macros SOLP
and SOLM to be the roots based on the positive and
negative square roots in the formulae above. Then we can
assign different values to the four variables and
instantly compute the related values for quadratic QUAD,
SOLM and SOLP.
Select command - mac quad v1*v4*v4 + v2*v4 + v3
Select command - mac solp ((v2*v2-4*v1*v3)pow0.5-v2)/(2*v1)
Select command - mac solm (0-(v2*v2-4*v1*v3)pow0.5-v2)/(2*v1)
Select command - der v1 3
Select command - der v2 5
Select command - der v3 1
Select command - der v4 1
Select command - ar quad
Select command - der v4 2
Select command - ar quad
Select command - der v4 3
Select command - ar quad
Select command - ar solp
Select command - ar solm
Select command - der v4 -0.232
Select command - ar quad
82
Special commands
Select command - der v4 -1.434
Select command - ar quad
The quadratic function is evaluated with V4, the fourth
general purpose variable, set to values of 1, 2 and 3 and
then the two roots are found. Then V4 is set equal to
each of the roots and the function is again evaluated.
Each time the result is close to zero, confirming that
the correct values for the roots have been calculated.
Here is another example of a macro which yields the
maximum of the values in the first three columns:
Select command - macro max2 c1*(c1>c2)+c2*(c2>=c1)
Select command - macro max3 c3*(c3>max2)+max2*(max2>=c3)
This first defines a macro MAX2 which is the maximum of
the first two columns, then uses this macro to define
MAX3, the maximum of the third column and MAX2. The macro
can then be used freely in subsequent expressions, e.g.:
Select command - der c5 7.2+max3*c4
Macros can be nested in this way, and complicated
mathematical expressions can be built up. The same rules
apply to naming macros as apply to labelling columns and
variables - please refer to these if you have problems,
especially with syntax errors. Macros already defined can
be listed with the key word LIST (which cannot be
abbreviated) instead of a macro name:
Select command - macro list
8:6. Limits
Format: Lim[its] [value]
Specifies a value for confidence limits to be output by
the BASICS, REGRESS and TTEST commands. The value
specified must be between 5 and 99.9 and is a percentage.
If a value of 0 is specified then confidence limits will
no longer be calculated.
Example:
Select command - lim 95
From now on 95% confidence limits will be calculated
where appropriate.
Calculating confidence limits can slow down the
performance of EASISTAT so this is only done if
specifically requested by the LIMITS command.
Alternatively the command line switch /L can be used when
EASISTAT is first run:
EASISTAT /L95
83
Special commands
8:7. Quit
Format: Q[uit]
Quits EASISTAT and returns control to the DOS command
line or the batch file from which EASISTAT was run.
Example:
Select command - q
Quit EASISTAT - ALL UNSAVED DATA WILL BE LOST -
Sure?
y
Confirmation that you really do wish to leave EASISTAT is
requested, so if you wish to have a command file which
does quit EASISTAT at the end, the line containing the
QUIT command must be followed by a line saying YES or Y.
84